def password_strength(pwd):
    count=0
    if len(pwd)<6:
        count=0
    else:
        if 6 <= len(pwd) < 8:
            count += 1
        if 8 <= len(pwd) < 12:
            count += 2
        if 12 <=len(pwd):
            count += 4
            # 将字符串转换成列表
        pwdlist = list(pwd)
        for i in range(len(pwd)):
            if 'A' <= pwdlist[i] <= 'Z':
                count += 2
                break
        for i in range(len(pwd)):
            if 'A' <= pwdlist[i] <= 'Z' or 'a' <= pwdlist[i] <= 'z':
                for j in range(len(pwd)):
                    if '0' <= pwdlist[i] <= '0':
                        count += 2
                        break
            break
        for i in range(len(pwd)):
            if ('A' <= pwdlist[i] <= 'Z' or 'a' <= pwdlist[i] <= 'z' or '0' <= pwdlist[i] <= '9'):
                count
            else:
                count += 2
                break
    return count

print("请输入密码：")
pwd=str(input())
print(password_strength(pwd))
